import cv2
import numpy as np

img=cv2. imread('./img/1.jpg',0)

reverse_img=255-img

cv2. imshow('srcimg',img)
cv2. imshow('reverse_img',reverse_img)
cv2.waitKey(0)